<template>
  <div>
    <el-form :model="formData" :rules="rules">
      <el-form-item label="手机号" prop="mobile">
        <el-input v-model="formData.mobile" />
      </el-form-item>
      <el-form-item label="密码" prop="password">
        <el-input v-model="formData.password" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formData: {
        mobile: '',
        password: ''
      },
      rules: {
        mobile: [
          { required: true, message: '选项不能为空', trigger: 'blur' },
          { pattern: /^1[3-9][0-9]{9}$/, message: '手机格式不符', trigger: 'blur' }
        ],
        password: [
          { required: true, message: '选项不能为空', trigger: 'blur' },
          { min: 6, max: 16, message: '密码要在6-16之间', trigger: 'blur' }
        ]
      }
    }
  }

}

</script>
<style>
</style>
